package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.github.chrisbanes.photoview.PhotoView
import com.jt.assistant.R
import com.jt.assistant.base.BaseApplication

class PicPreAdapter(mData: MutableList<String>) :
    BaseQuickAdapter<String, BaseViewHolder>(
        R.layout.item_pic_pre, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: String) {
        val photoView = holder.getView<View>(R.id.photo_view) as PhotoView
        val tvPage = holder.getView<View>(R.id.tv_page) as TextView
        Glide.with(BaseApplication.getContext())
            .load(item)
            .into(photoView)
//        photoView.load(item)
        tvPage.text = (getItemPosition(item) + 1).toString() + "/" + itemCount

    }


}